<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="java.util.*" %>
<%@ page import="com.kylin.common.entity.Menu,com.kylin.common.util.MemObjFactory" %>
<%
String chanle_study = "study";
String chanle_shop = "shop";
String chanle_community = "community";
String chanle_sysem = "system";
String chanle_service = "service";
String chanle_special = "special";
String chanle_exhibition = "exhibition";
//String chanle_study = "study";
%>
<%
MemObjFactory.adminMenus.clear();
	if(MemObjFactory.adminMenus.size() < 1){
	    Menu studyMenu = new Menu(chanle_study,"学习管理","/admin/manage.jsp?currChanleName="+chanle_study);
	    Menu wordMenu = new Menu("word","词汇管理",null);
	    wordMenu.addSubMenu(new Menu("","词汇列表","/admin/study/manageVocabulary.do?CMD=search"));
	    wordMenu.addSubMenu(new Menu("","添加词汇","/admin/study/vocabularyAdd.jsp"));
	    wordMenu.addSubMenu(new Menu("","词汇报错列表","/admin/study/manageVocabulary.do?CMD=searchError"));
	    studyMenu.addSubMenu(wordMenu);
	    Menu lessionMenu = new Menu("lession","课件管理",null);
	    lessionMenu.addSubMenu(new Menu("","课件列表","/admin/study/manageCourseware.do?CMD=search"));
	    lessionMenu.addSubMenu(new Menu("","添加课件","/admin/study/coursewareAdd.jsp"));
	    studyMenu.addSubMenu(lessionMenu);
	    Menu articleMenu = new Menu("article","文章管理",null);
	    articleMenu.addSubMenu(new Menu("","文章列表","/admin/study/manageArticle.do?CMD=search"));
	    articleMenu.addSubMenu(new Menu("","添加文章","/admin/study/articleAdd.jsp"));
	    studyMenu.addSubMenu(articleMenu);
	
	
	    Menu shopMenu = new Menu("shop","商城管理","/admin/manage.jsp?currChanleName=shop");
	    Menu supplierMenu = new Menu("supplier","商家管理",null);
	    supplierMenu.addSubMenu(new Menu("","商家列表","/admin/shop/manageShop.do?CMD=searchCompany"));
	    supplierMenu.addSubMenu(new Menu("","审核商家申请","/admin/shop/manageShop.do?CMD=searchRegCompany"));
	    supplierMenu.addSubMenu(new Menu("","产品分类列表","/admin/shop/listProductDict.jsp"));
	    shopMenu.addSubMenu(supplierMenu);
	    Menu tradeMenu = new Menu("trade","供求信息维护",null);
	    tradeMenu.addSubMenu(new Menu("","供求信息添加","/admin/shop/tradeAdd.jsp"));
	    tradeMenu.addSubMenu(new Menu("","供求信息列表","/admin/shop/manageTrade.do?CMD=manageTradeList"));
	    shopMenu.addSubMenu(tradeMenu);
	    Menu accessMenu = new Menu("access","查阅信息维护",null);
	    accessMenu.addSubMenu(new Menu("","查阅信息添加",""));
	    accessMenu.addSubMenu(new Menu("","查阅信息列表",""));
	    shopMenu.addSubMenu(accessMenu);
	    
   		Menu othersMenu = new Menu("others","其它信息维护",null);
	    othersMenu.addSubMenu(new Menu("","询盘信息","/admin/shop/searchManage.do?CMD=manage9&CMD1=manage"));
	    othersMenu.addSubMenu(new Menu("","订阅信息","/admin/shop/subUser.do?CMD=showAllSub"));
	    shopMenu.addSubMenu(othersMenu);
	
	    Menu communityMenu = new Menu("community","社区管理","/admin/manage.jsp?currChanleName=community");
	    Menu memberMenu = new Menu("member","会员管理",null);
	    memberMenu.addSubMenu(new Menu("","会员列表","/admin/community/listMember.jsp"));
	    memberMenu.addSubMenu(new Menu("","帖子列表","/admin/community/listPost.jsp"));
	    communityMenu.addSubMenu(memberMenu);
	
	    Menu systemMenu = new Menu(chanle_sysem,"系统管理","/admin/manage.jsp?currChanleName="+chanle_sysem);
	    Menu dictMenu = new Menu("dict","属性字典管理",null);
	    dictMenu.addSubMenu(new Menu("addcat","增加属性字典","/admin/dict/addCatDict.jsp"));
	    dictMenu.addSubMenu(new Menu("catlist","属性字典列表","/admin/dict/manageCatDict.do?CMD=search"));
	    dictMenu.addSubMenu(new Menu("repair","修复数据","/admin/util/repairData.jsp"));
		systemMenu.addSubMenu(dictMenu);
		 // 定义服务的菜单
	    Menu serviceMenu = new Menu(chanle_service,"服务管理","/admin/manage.jsp?currChanleName="+chanle_service);	    
	    Menu serviceListMenu = new Menu("service","服务请求管理",null);
	    serviceListMenu.addSubMenu(new Menu("list","查看服务请求","/admin/service/manageService.do?CMD=search"));
	    serviceMenu.addSubMenu(serviceListMenu);
	    Menu ADListMenu = new Menu("service","广告管理",null);
	    ADListMenu.addSubMenu(new Menu("list","广告类型列表","/admin/ad/manageADType.do?CMD=searchADType"));
	    ADListMenu.addSubMenu(new Menu("add", "增加广告类型","/admin/ad/addADType.jsp"));
	    ADListMenu.addSubMenu(new Menu("list","广告列表","/admin/ad/manageAD.do?CMD=searchAD"));
	    ADListMenu.addSubMenu(new Menu("add", "增加广告","/admin/ad/addAD.jsp"));
	    serviceMenu.addSubMenu(ADListMenu);
	    //定义专题的菜单 
	    Menu spacialMenu = new Menu(chanle_special,"专题管理","/admin/manage.jsp?currChanleName="+chanle_special);	    
   
	    Menu spacialMenu_content = new Menu("service","专题内容维护",null);
	    spacialMenu_content.addSubMenu(new Menu("list","新添专题文章","/admin/special/specialAdd.jsp"));
	    spacialMenu_content.addSubMenu(new Menu("list","专题文章列表","/admin/special/manageSpecial.do?CMD=search"));
		spacialMenu_content.addSubMenu(new Menu("list","热点文章列表","/admin/special/manageSpecial.do?CMD=searchHot"));
	    spacialMenu.addSubMenu(spacialMenu_content);
	    //定义会展信息的菜单
	    Menu exhibitionMenu = new Menu(chanle_exhibition,"会展管理","/admin/manage.jsp?currChanleName="+chanle_exhibition);
	    Menu exhibitionMenu_content = new Menu("exhibition","会展信息维护",null);
		exhibitionMenu_content.addSubMenu(new Menu("","添加会展信息","/admin/exhibition/exhibitionAdd.jsp")); 
	    exhibitionMenu_content.addSubMenu(new Menu("","会展信息列表","/admin/exhibition/manageExhibition.do?CMD=search"));
	    exhibitionMenu.addSubMenu(exhibitionMenu_content);
	    
	    MemObjFactory.adminMenus.put(chanle_study,studyMenu);
	    MemObjFactory.adminMenus.put(chanle_shop,shopMenu);
	    MemObjFactory.adminMenus.put(chanle_community,communityMenu);
	    MemObjFactory.adminMenus.put(chanle_service,serviceMenu); //加上服务的菜单
	    MemObjFactory.adminMenus.put(chanle_sysem,systemMenu);
	    MemObjFactory.adminMenus.put(chanle_special,spacialMenu);
	    MemObjFactory.adminMenus.put(chanle_exhibition,exhibitionMenu);
	 }

	String chanleName = request.getParameter("currChanleName");
	if(chanleName == null){
	    chanleName = (String)session.getAttribute("adminChanleName");
	    if(chanleName == null)
	        chanleName = chanle_study;
	}
	session.setAttribute("adminChanleName",chanleName);
	Menu currChanle = (Menu)MemObjFactory.adminMenus.get(chanleName);
    if(currChanle == null)
        currChanle = new Menu("","没有定义菜单："+chanleName,null);
%>
